<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>Regions in each league</TITLE>
</HEAD>
<BODY>
<TABLE>
	<TR><TD>LeagueID</TD><TD>ShortName</TD><TD>RegionID</TD><TD>RegionName</TD></TR>
<?php

require_once("database.inc.php");
require_once("track.inc.php");

$dbh = connect_db("gene");
hit();

$query = "SELECT ShortName, regions.* FROM leagues, regions WHERE leagues.LeagueID = regions.LeagueID ORDER BY LeagueID, RegionID";
$regions = mysql_query($query, $dbh);
while ($region = mysql_fetch_array($regions)) {
	echo "\t<TR><TD>{$region['LeagueID']}</TD><TD>{$region['ShortName']}</TD><TD>{$region['RegionID']}</TD><TD>{$region['RegionName']}</TD></TR>\n";
}
?>
</TABLE>
</BODY>
</HTML>

<?php
/*
require_once("database.inc.php");

$dbh = connect_db();

$lastfetch = mysql_result(mysql_query("SELECT MAX(finish) FROM scans", $dbh), 0);
?>

<?xml version="1.0"?>
<HattrickData>
	<FileName>regionsperleague.php</FileName>
	<Version>1.1</Version>
	<FetchedDate><?php echo $lastfetch; ?></FetchedDate>
	<ActionType>view</ActionType>
	<?php $leagues = $mysql_query("SELECT LeagueID, ShortName FROM leagues ORDER BY LeagueID", $dbh);
	echo "\t<LeagueList Count=\"".mysql_num_rows($leagues)."\">";
	while ($league = mysql_fetch_array($leagues)) { ?>
		<League>
			<LeagueID><?php ?></LeagueID>
			<LeagueName>Nederland</LeagueName>
			<Region>
			<RegionID>315</RegionID>
			<RegionName>Amsterdam</RegionName>
			<WeatherID>1</WeatherID>

				<TomorrowWeatherID>0</TomorrowWeatherID>
				<NumberOfUsers>3760</NumberOfUsers>
				<NumberOfOnline>209</NumberOfOnline>
			</Region>
		</League>
	} ?>
	</League>
	</LeagueList>
</HattrickData>
*/
?>
